package com.jh.channel.repository;

import com.jh.channel.pojo.fastsilver.FastSilverInternal;
import com.jh.channel.pojo.fastsilver.LoginStatus;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import java.util.List;


@Repository
public interface FastSilverInternalRepository extends JpaRepository<FastSilverInternal,String>,
        JpaSpecificationExecutor<FastSilverInternal> {

    FastSilverInternal findByUserId(String userId);

    FastSilverInternal findByPhone(String phone);

    @Query("select internal from  FastSilverInternal internal where internal.status=:status")
    List<FastSilverInternal> findByStatus(@Param("status") LoginStatus status);
}
